package com.example.demo38inheritablethreadlocal.thread;

import java.util.concurrent.TimeUnit;

public class ThreadLocalTest {


    public static void main(String[] args) {
        ThreadLocal<String> threadLocal = new ThreadLocal<>();
        threadLocal.set("hello");
        System.out.println("threadLocal.get() = " + threadLocal.get());
        new Thread(() -> {
            String name = Thread.currentThread().getName();
            System.out.println("name + threadLocal.get() = " + name + ":" + threadLocal.get());
        }).start();
    }

}
